home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
ohlutil.zip
/
CP.H
< prev
next >
Wrap
C/C++ Source or Header
|
1990-06-14
|
3KB
|
123 lines
/* cp.h -- file copying (data definitions)
Copyright (C) 1989, 1990 Free Software Foundation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Written by Torbjorn Granlund, Sweden (tege@sics.se). */
#include <sys/types.h>
#include "system.h"
struct dir_list
{
struct dir_list *parent;
ino_t ino;
dev_t dev;
};
struct entry
{
ino_t ino;
dev_t dev;
char *node; /* Path name, or &new_file for new inodes. */
struct entry *coll_link; /* 0 = entry not occupied. */
};
struct htab
{
unsigned modulus; /* Size of the `hash' pointer vector. */
struct entry *entry_tab; /* Pointer to dynamically growing vector. */
unsigned entry_tab_size; /* Size of current `entry_tab' allocation. */
unsigned first_free_entry; /* Index in `entry_tab'. */
struct entry *hash[1]; /* Vector of pointers in `entry_tab'. */
};
extern int exit_status;
extern struct htab *htab;
extern char *xmalloc ();
extern char *xrealloc ();
extern void forget_copied ();
extern void forget_all ();
extern int copy_reg ();
extern void hash_init ();
extern char *remember_copied ();
extern int remember_created ();
/* For created inodes, a pointer in the search structure to this
character identifies that the inode as new. */
extern char new_file;
extern void error ();
extern void usage ();
extern char *savedir ();
extern char *str_cpy ();
extern int yesno ();
extern int do_copy ();
extern int copy ();
extern int copy_dir ();
extern void strip_trailing_slashes ();
extern int is_ancestor ();
/* System calls. */
extern int mknod ();
#ifdef _POSIX_SOURCE
#define S_IWRITE S_IWUSR
#define S_IEXEC S_IXUSR
#else
extern int open ();
extern int close ();
extern int fstat ();
extern int stat ();
extern int lstat ();
extern int read ();
extern int write ();
extern int symlink ();
extern int readlink ();
extern int mkdir ();
#if 0 /* Breaks on SunOS 4.1. */
extern int umask ();
#endif
extern int unlink ();
extern int link ();
extern int chmod ();
extern int chown ();
extern int fchmod ();
extern int access ();
extern int utime ();
extern int ftruncate ();
extern int isatty ();
extern off_t lseek ();
#endif
/* Library calls. */
#include <errno.h>
#ifdef STDC_HEADERS
#include <stdlib.h>
#else
extern char *getenv ();
extern char *malloc ();
extern char *realloc ();
extern int free ();
extern void exit ();
extern int fprintf ();
extern int fputs ();
extern int printf ();
extern int errno;
#endif